<include file="Public:head"/>
<div class="main-container" id="main-container">
    <div class="main-container-inner">
        <include file="Public:left" />
        <div class="main-content">
            <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li><i class="icon-home home-icon"></i><a href="__APP__/{$Think.MODULE_NAME}">首页</a></li>
                    <li><a href="{:U('Jquery/lists')}">17sucai管理</a></li>
                    <li class="active">17sucai列表({$count})</li>
                </ul>
            </div>
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="row">
                            <div class="col-xs-12">
                                <div class="header smaller lighter blue">
                                    <div class="nav-search col-xs-10" id="nav-search">
                                        <form class="form-search" method="get">
                                            <div class="search_area">

                                                <select name="is_download" autocomplete="off">
                                                    <option value="">请选择是否下载</option>
                                                    <option value="0"<if condition="$is_download eq 0 && $is_download neq ''">selected</if>>未下载</option>
                                                    <option value="1"<if condition="$is_download eq 1">selected</if>>已下载</option>
                                                    <option value="-1"<if condition="$is_download eq -1">selected</if>>下载失败</option>
                                                </select>
                                                <select name="category_id" id="category_id" autocomplete="off">
                                                    <option value='0'>请选择分类</option>
                                                    <foreach name="categories" item="row">
                                                        <option value="{$row.id}"<if condition="$row.id eq $category_id">selected</if>>{$row.name}</option>
                                                    </foreach>
                                                </select>
                                                <select name="url_type" id="url_type" autocomplete="off">
                                                    <option value=''>请选择是否推送到素材火</option>
                                           <option value="0"<if condition="$url_type eq 0 && $url_type neq ''">selected</if>>未推送</option>
                                                        <option value="1"<if condition="$url_type eq 1">selected</if>>已推送</option>
                                          
                                                </select>
                                                <input class="form-control search-query" type="text" name="keyword" style='width:220px' autocomplete="off"  placeholder="请输入标题" value="{$Think.get.keyword}">
                                                <button class="btn btn-purple btn-sm" type="submit">搜 索 <i class="icon_search icon-on-right bigger-110"></i></button>
                                                <input type="hidden" name="p" value="1"/>
                                            </div>
                                        </form>
                                    </div>
                                    <div class='cl'></div>
                                </div>
                                <notempty name='lists'>
                                    <div class="table-responsive">
                                        <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                                            <thead>
                                                <tr>
                                                    <th width='45px' class="center">ID</th>
                                                    <th width="180px">名称</th>
                                                    <th>积分</th>
                                          <th>描述</th>
                                                    <th width="180px">分类</th>
                                                    <th width='45px'>logo</th>
                                                    <th width='85px'>下载状态</th>
                                                     <th width="55px">下载次数</th>
                                                        <th width="55px">金币</th>
                                                    <th width="55px">17sucai路径</th>
                                                      <th width="55px">17素材详情页</th>
                                                    <th width="55px">17sucai演示地址</th>
                                                    <!--                                                       <th width="75px">17sucai显示状态</th>-->
                                                         <th width="75px">是否开启</th>
                                                    <th width="85px">推送</th>
                                                    <th width="60px"><i class="icon-time bigger-110 hidden-480"></i>时间</th>
                                                    <th width="50px">操作</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                            <foreach name="lists" item="row">
                                                <tr>
                                                    <td class="center">{$row.id}</td>
                                                    <td><a href="{$row.url}" target="_blank">{$row.title|msubstr=0,32,'utf-8',true}</a></td>
                                                    <td class="center">{$row.points}</td>
                                                   <td>{$row.shop|urlToLink}</td>
                                                    <td class="center">{$row.category_top_name} - {$row.category_name}</td>
                                                    <td><a class="fancybox_img" title="{$row.title}" href="http://17sucai.com/{$row.demoimage}"><img src="http://17sucai.com/{$row.demoimage}"style="width:45px;height:45px"></a></td>

                                                    <td>{$row.is_download|getDownloadState}</td>
                                                               <td>{$row.download_number}</td>
                                                                  <td>{$row.price}</td>
                                                    <td><a href="{$row.url}" target="_blank">{$row.file_17}</a></td>
                                                       <td><a href="http://www.17sucai.com/pins/{$row.id}.html" target="_blank">http://www.17sucai.com/pins/{$row.id}.html</a></td>
                                                    <td><a href="http://www.17sucai.com/pins/demoshow/{$row.id}" target="_blank">http://www.17sucai.com/pins/demoshow/{$row.id}</a></td>
                                                    <!--                                                     <td><if condition="$row.publish eq 1">是<else/><span style="color:red">否</span></if></td>-->
                                                    <!--                                                    <td><a onclick="changeOrd($(this), 'js', '{$row.id}')">{$row.ord}</a></td>-->
                                                                <td id="is_show_{$row.id}"><a onclick="yes_17('{$row.id}', 'pins', 'is_show')"><if condition="$row.is_show eq 0">是<else/><span style="color:red">否</span></if></a></td>
                                                    <td>
                                                <if condition="$row.is_download eq 1 && $row['is_modal_js'] eq 1"><a onclick="yiqi_push('{$row.id}')">推送到素材火</a></if>
                                                   <if condition="$row.huo_id gt 0">
                                                       <p><a href="http://www.sucaihuo.com/Tian/{$row.url_type}/detail/id/{$row.huo_id}" style="color:green" target='_blank'>后台详情</a></p>
                                                       <p><a href="http://www.sucaihuo.com/{$row.url_type2}/{$row.huo_id}" style="color:green" target='_blank'>前台详情</a></p>
                                                       <a href="{$row.url_demo}" style="color:green" target='_blank'>前台demo</a>
                                                   </if>
                                            </td>

                                                <td>{$row.createat|date="Y-m-d H:i",###}</td>
                                                <td class="action-buttons">
                                                    <a class="purple" data-rel="tooltip" data-original-title="演示地址" href="{$row.id|getJqueryDemo}" target="_blank"><i class="icon-facetime-video bigger-130"></i></a>
                                                    <a class="green" href="{:U('Jquery/detail',array('id'=>$row['id']))}" data-rel="tooltip" data-original-title="编辑"><i class="icon-pencil bigger-130"></i></a>
                                                </td>
                                                </tr>
                                            </foreach>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div id="grid-pager" class="ui-state-default  ui-corner-bottom" dir="ltr">
                                        <table width='100%' data-table='Jquery'  id='modal_del_table'>
                                            <tr>
                                                <td>

                                                </td>
                                                <td class='td_pager'><div class='pager'>{$page}</div></td>
                                            </tr>
                                        </table>
                                    </div>
                                    <else/>
                                    <p class='noempty'>没有符合条件的记录！</p>
                                </notempty>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <include file="Public:setting" />
    </div>
</div>

<include file="Public:state" />
<include file="Public:foot" />
<div class="modal fade" id="modal_yiqi_push">
    <div class="modal-dialog" style="width:1000px">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">推送到</h4>
            </div>
            <div class="modal-body" id="modal_yiqi_push_body">
                
            </div>
            <div class="modal-footer">
                <button class="btn btn-xs ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" type="button" role="button" aria-disabled="false" data-dismiss="modal">
                    <span class="ui-button-text">
                        <i class="icon-remove bigger-110"></i>
                        取 消
                    </span>
                </button>
            </div>
        </div>
    </div>
</div>
<script>
    function yiqi_push(id) {
         
        $.post("{:U('Box/yiqi_push')}", {id:id}, function(data) {
            $("#modal_yiqi_push_body").html(data);
$("#modal_yiqi_push").modal();
        })
    }
        function yes_17(id, table, field) {
    $.post(getUrl("Ajax/yes_17"), {
        id: id,
        table: table,
        field: field
    }, function(data) {
        if (data == "否") {
            $('#' + field + '_' + id).html("<a onclick=yes_17(" + id + ",'" + table + "','" + field + "')><span style='color:red'>" + data + "</span></a>");
        } else {
            $('#' + field + '_' + id).html("<a onclick=yes_17(" + id + ",'" + table + "','" + field + "')>" + data + "</a>");
        }
    })
}
</script>